// Binary Clock .NET (systray clock displays time in binary notation)
// Copyright (C) 2004  Bartosz 'Xebord' Janowski
//					   (email: xebord at siodemka p lodz pl)
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.



using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace BinClock
{
	/// <summary>
	/// Summary description for AboutForm.
	/// </summary>
	public class AboutForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.LinkLabel JonsBinClockLink;
		private System.Windows.Forms.GroupBox AboutGroupBox;
		private System.Windows.Forms.Label InfoLabel;
		private System.Windows.Forms.Button buttonOK;
		private System.Windows.Forms.LinkLabel JoshuaEncoder;
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.Label NameAppLabel;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public AboutForm( Icon icon, String info)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//

			Icon = icon;

			this.InfoLabel.Text = info;
			this.InfoLabel.Text += "\nLicence: The GNU GPL";

			this.JonsBinClockLink.LinkArea = new LinkArea( 0, 0);
			this.JonsBinClockLink.Links.Add( 12, 18, "http://snoopy.net/jbc/");

			this.JoshuaEncoder.LinkArea = new LinkArea( 0, 0);
			this.JoshuaEncoder.Links.Add( 34, 11, "http://www.codeproject.com/dotnet/safeicon.asp");
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

	#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AboutForm));
			this.NameAppLabel = new System.Windows.Forms.Label();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.JoshuaEncoder = new System.Windows.Forms.LinkLabel();
			this.buttonOK = new System.Windows.Forms.Button();
			this.InfoLabel = new System.Windows.Forms.Label();
			this.AboutGroupBox = new System.Windows.Forms.GroupBox();
			this.JonsBinClockLink = new System.Windows.Forms.LinkLabel();
			this.AboutGroupBox.SuspendLayout();
			this.SuspendLayout();
			// 
			// NameAppLabel
			// 
			this.NameAppLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(238)));
			this.NameAppLabel.Location = new System.Drawing.Point(120, 23);
			this.NameAppLabel.Name = "NameAppLabel";
			this.NameAppLabel.Size = new System.Drawing.Size(128, 16);
			this.NameAppLabel.TabIndex = 1;
			this.NameAppLabel.Text = "Binary Clock .NET";
			// 
			// pictureBox1
			// 
			this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
			this.pictureBox1.Location = new System.Drawing.Point(16, 32);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new System.Drawing.Size(72, 72);
			this.pictureBox1.TabIndex = 2;
			this.pictureBox1.TabStop = false;
			// 
			// JoshuaEncoder
			// 
			this.JoshuaEncoder.LinkArea = new System.Windows.Forms.LinkArea(34, 45);
			this.JoshuaEncoder.Location = new System.Drawing.Point(16, 126);
			this.JoshuaEncoder.Name = "JoshuaEncoder";
			this.JoshuaEncoder.Size = new System.Drawing.Size(144, 32);
			this.JoshuaEncoder.TabIndex = 5;
			this.JoshuaEncoder.TabStop = true;
			this.JoshuaEncoder.Text = "Thanks to Joshua Flanagan for his IconEncoder";
			this.JoshuaEncoder.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkClicked);
			// 
			// buttonOK
			// 
			this.buttonOK.Cursor = System.Windows.Forms.Cursors.Default;
			this.buttonOK.Location = new System.Drawing.Point(208, 136);
			this.buttonOK.Name = "buttonOK";
			this.buttonOK.Size = new System.Drawing.Size(70, 23);
			this.buttonOK.TabIndex = 0;
			this.buttonOK.Text = "OK";
			this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
			// 
			// InfoLabel
			// 
			this.InfoLabel.Location = new System.Drawing.Point(104, 49);
			this.InfoLabel.Name = "InfoLabel";
			this.InfoLabel.Size = new System.Drawing.Size(180, 39);
			this.InfoLabel.TabIndex = 0;
			// 
			// AboutGroupBox
			// 
			this.AboutGroupBox.Controls.Add(this.JoshuaEncoder);
			this.AboutGroupBox.Controls.Add(this.JonsBinClockLink);
			this.AboutGroupBox.Controls.Add(this.NameAppLabel);
			this.AboutGroupBox.Controls.Add(this.InfoLabel);
			this.AboutGroupBox.Controls.Add(this.pictureBox1);
			this.AboutGroupBox.Controls.Add(this.buttonOK);
			this.AboutGroupBox.Location = new System.Drawing.Point(24, 16);
			this.AboutGroupBox.Name = "AboutGroupBox";
			this.AboutGroupBox.Size = new System.Drawing.Size(294, 176);
			this.AboutGroupBox.TabIndex = 0;
			this.AboutGroupBox.TabStop = false;
			this.AboutGroupBox.Text = "Binary Clock .NET";
			// 
			// JonsBinClockLink
			// 
			this.JonsBinClockLink.LinkArea = new System.Windows.Forms.LinkArea(0, 18);
			this.JonsBinClockLink.Location = new System.Drawing.Point(104, 94);
			this.JonsBinClockLink.Name = "JonsBinClockLink";
			this.JonsBinClockLink.Size = new System.Drawing.Size(176, 16);
			this.JonsBinClockLink.TabIndex = 4;
			this.JonsBinClockLink.TabStop = true;
			this.JonsBinClockLink.Text = "Inspired by Jon\'s Binary Clock";
			this.JonsBinClockLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkClicked);
			// 
			// AboutForm
			// 
			this.AccessibleRole = System.Windows.Forms.AccessibleRole.Dialog;
			this.AutoScale = false;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
			this.ClientSize = new System.Drawing.Size(338, 215);
			this.Controls.Add(this.AboutGroupBox);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "AboutForm";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "About Binary Clock";
			this.TopMost = true;
			this.AboutGroupBox.ResumeLayout(false);
			this.ResumeLayout(false);
		}
		#endregion	

		private void LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			System.Diagnostics.Process.Start( e.Link.LinkData.ToString());
		}

		private void buttonOK_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}
	}
}
